﻿package org.bao.action;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓


	//沙箱APPID
	public static final  String app_id = "2016092200567832";
	//沙箱私钥
	public static final  String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCAD+lzlolE/vwBgs76JY+uPFXzY2f5ikmt+K1j5I9/wiSazgDXZUSM+xvqYxcaPcntlSVIO7KfjYfyuLUjXCp3dd9dhDGx+I4lWN+IxchRJMvv5w7pbAC0UWZ8PX45oZvVrhijVDtGBa2lWeyQX9WFNKdYTMGtTEmFso9ST+Q+sLA+8gbQEuWCa/LNlt6Xm56DJeyiiMpyN4q9Mf6pG2Bdz59qpBu9EQrgQGVZWU4Pj8o9a0s1A3C4xpLN414UCdoA17Qt5Vv15CTcIn5NM8Nc/0FpqGfa3pOmQqm/L0LovkrZEr1pulG9jez5U1c5eJwlwt4Y5+BrPL+8FFqohJS3AgMBAAECggEATrl5afVArYmSodsoId61VQcCT3zsjhrU8H3PGXmIPaG7nu7E1aULXx9/KbeAnEEfwU3OfXk1daAr0qp5sCMYeBeeGH8LjbyepZbc09fCLR/RvsjsAdLDHBZuSjIDRqpygglkXAOL7J/Q/7UoGBjRyfF0bnPBHCepiucZ9B/o0CAuqbRM3evTmVI4FmDgd80pvR9c2iLAiVWwPbOXxc5rfTcU9P2vnzyL9SGMUqbrQCyX0MKsESQB2+J6ffs6aYnRsBxW3e3McFRMt/fkGqVxZSkvGK2YsxJp6wdvf1ygOO93VvzLPcMHgsFssZr5Ga7xt84q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Xi0EZXStJuKKaEnNSDMIDK/Qv5x7j9JFZVe8hiMRrj2F4xqJHC+7vdN2oyWAhGL2U0cQYk2t0iO2mpgp6w/mkNhMaNJRzt2BytXLdT+RW1n3CFLdKDdEHe2ow3XCNseLr9ko1Y8+TpYcVjNa2So9pPeCW8re7UG/xdZVGE3om7HNpzVSu5I3gMMorW4K335dBcHBPssJ1rZjB8LFReB9wwWJWSTbsJ/yQrzuPsUQvQVowGJx9VjwIDAQAB";
	//沙箱网关地址
	public static final  String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

//	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

//	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问          设置回调地址
	public static String return_url = "http://www.baidu.com/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";

	
	// 支付宝网关
	public static String log_path = "F:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

